<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
  <meta charset="utf-8">
  <title>课程目录主页</title>
  <meta name="renderer" content="webkit">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  <link rel="stylesheet" href="/qcby/layuiadmin/layui/css/layui.css" media="all">
  <link rel="stylesheet" href="/qcby/layuiadmin/style/admin.css" media="all">
</head>
<body>

  <div class="layui-fluid">
    <div class="layui-row layui-col-space15">
      <div class="layui-col-md8">    
        <div class="layui-card">
          <div class="layui-card-header">
            考试课程目录
          </div>
          <a data-method="notice" style="position:absolute;margin-left: 188px;margin-top: -40px;" class="layui-btn layuiadmin-btn-admin" lay-href="/qcby/views/home/addclass.html">添加课程</a>
          <div class="layui-card-body">
            <div class="layui-row layui-col-space10" th:each="list:${list}">
              <div class="layui-col-xs12 layui-col-sm4" style="border-width: medium;">
                <div class="layuiadmin-card-text">
                  <div class="layui-text-top"><i class="layui-icon layui-icon-water"></i><a th:text="${list.claProject}" th:lay-href="'/qcby/views/home/timu.html?project='+${list.claProject}+'&claName='+${list.claName}"></a></div>
                  <p class="layui-text-center">班级：<span th:text="${list.claName}"></span></p>
                  <p class="layui-text-bottom" style="display: flex;justify-content: space-between;cursor: pointer;">
                    <a th:lay-href="'/qcby/views/home/timu.html?project='+${list.claProject}+'&claName='+${list.claName}">开始出题</a>
                    <a th:onclick="delCla([[${list.claId}]]);">移除本课程</a>
                  </p>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="layui-col-md4">
        <div class="layui-card">
          <div class="layui-card-header">娱乐内容</div>
          <div class="layui-card-body">
              <div class="layui-carousel layadmin-carousel layadmin-dataview" data-anim="fade" lay-filter="LAY-index-pageone">
                <div carousel-item id="LAY-index-pageone">
                  <div><i class="layui-icon layui-icon-loading1 layadmin-loading"></i></div>
                </div>
              </div>
          </div>
        </div>

      </div>
    </div>
  </div>

  <script src="/qcby/layuiadmin/layui/layui.js"></script>
  <script src="/qcby/layuiadmin/jquery.js"></script>
  <script>
  layui.config({
    base: '/qcby/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'sample','layedit','jquery']);

  //自定义脚本函数
  function delCla(claId) {
    layer.open({
      content: '确定删除吗？'
      ,btn: ['确定', '取消']
      ,yes: function(index, layero){
        $.ajax({
          type:'post',
          url:'/qcby/teacher/delcla',
          data:{
            claId:claId
          },
          cache: false,
          async : false,
          success:function (data) {
            if(data.code == 0){
              layer.alert("移除成功",{icon:1});
            }else {
              layer.alert("出现错误",{icon:2});
            }
          }
        });
      }
    });

  }
  </script>
</body>
</html>